from django.db import models

# Create your models here.


class Question(models.Model):
    text = models.TextField(verbose_name='问题内容', max_length=200)
    pub_date = models.DateTimeField('发布时间')

    def __repr__(self):
        return self.text


class Choice(models.Model):
    text = models.TextField('选项内容', max_length=100)
    votes = models.IntegerField('投票次数', default=0)
    question = models.ForeignKey(Question, on_delete=models.CASCADE)